Add ask plugin#9
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds a new Changesbuiltin-ai-ask plugin and ask CLI command
Sequence DiagramsequenceDiagram
participant User
participant sibyl as sibyl CLI
participant handleAsk as handleAsk
participant askFn as builtin-ai-ask askFn
participant fetchPlugin as fetch plugin
participant LLM as LLM provider (ai SDK)
User->>sibyl: sibyl ask <url> <question>
sibyl->>handleAsk: handleAsk(url, query, context)
handleAsk->>askFn: askPlugin.fn(url, query, context)
askFn->>fetchPlugin: fetchPlugin.fn(url, context)
fetchPlugin-->>askFn: page content
askFn->>LLM: generateText(model, systemPrompt, prompt+content, AbortSignal)
LLM-->>askFn: answer text
askFn-->>handleAsk: trimmed answer
handleAsk-->>User: prints answer
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/CONFIGURATION.md (1)
8-21:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate default config example to include the
askplugin.The example JSON on lines 8–21 shows only
search,fetch, andparseplugins, but persrc/setup.ts(lines 51–71), the actual default config written includesask: "builtin-ai-ask". The example should match the implementation to avoid confusing users about what the default setup includes.📝 Proposed fix
{ "plugins": { "search": "builtin-searxng-search", "fetch": "builtin-crawl4ai-fetch", "parse": "builtin-parse-htmlToMd" + "ask": "builtin-ai-ask", }, "variables": [ {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/CONFIGURATION.md` around lines 8 - 21, The example JSON configuration in the CONFIGURATION.md file (lines 8–21) is missing the `ask` plugin which is included in the actual default configuration implemented in src/setup.ts. Add the `ask: "builtin-ai-ask"` entry to the plugins object in the example JSON so that it matches the actual default setup and provides users with an accurate representation of what gets configured by default.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/plugins/builtin-ai-ask/main.test.ts`:
- Around line 19-20: The TypeScript comment directive `@ts-ignore` on the line
above mockedGenerateText.mockResolvedValue({ text }) violates the
`@typescript-eslint/ban-ts-comment` linting rule. Replace `@ts-ignore` with
`@ts-expect-error` while keeping the existing description "Complicated type,
ignoring for now" to satisfy the ESLint configuration requirement that bans
`@ts-ignore` in favor of the more explicit `@ts-expect-error` directive.
In `@src/plugins/builtin-ai-ask/main.ts`:
- Line 6: Remove the module-scope type import of LanguageModelV3 from the
`@openrouter/ai-sdk-provider` package at line 6. SDK package references are only
allowed via dynamic import() calls inside function implementations, not at
module scope. If LanguageModelV3 is needed for type annotations elsewhere in the
module, move the import inside the relevant function implementations using
dynamic import syntax instead.
---
Outside diff comments:
In `@docs/CONFIGURATION.md`:
- Around line 8-21: The example JSON configuration in the CONFIGURATION.md file
(lines 8–21) is missing the `ask` plugin which is included in the actual default
configuration implemented in src/setup.ts. Add the `ask: "builtin-ai-ask"` entry
to the plugins object in the example JSON so that it matches the actual default
setup and provides users with an accurate representation of what gets configured
by default.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f298d5ce-dad8-4e59-aa6a-924fc834c0cc
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
CLAUDE.mdREADME.mddocs/CONFIGURATION.mdpackage.jsonsrc/cli.tssrc/plugins/builtin-ai-ask/main.test.tssrc/plugins/builtin-ai-ask/main.tssrc/plugins/config.test.tssrc/plugins/config.tssrc/setup.test.tssrc/setup.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@codecov.yml`:
- Line 9: The patch coverage target value has been reduced from 90% to 85% in
the codecov configuration, which weakens quality enforcement on changed code.
Either revert the target back to 90% to maintain the original quality gate, or
if the reduction is intentional, add clear documentation and rationale in the PR
description explaining why the target was lowered and include a follow-up plan
to restore it to 90%.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 542b2112-7333-467c-b936-a2e198404518
📒 Files selected for processing (5)
codecov.ymldocs/CONFIGURATION.mdsrc/cli.test.tssrc/plugins/builtin-ai-ask/main.test.tssrc/plugins/builtin-ai-ask/main.ts
✅ Files skipped from review due to trivial changes (1)
- docs/CONFIGURATION.md
🚧 Files skipped from review as they are similar to previous changes (2)
- src/plugins/builtin-ai-ask/main.test.ts
- src/plugins/builtin-ai-ask/main.ts
| patch: | ||
| default: | ||
| target: 90% | ||
| target: 85% |
There was a problem hiding this comment.
Avoid weakening the patch coverage gate without documented rationale.
Reducing the patch target from 90% to 85% lowers quality enforcement on changed code. Please keep 90% or add a clear justification in PR docs/description and a follow-up plan to restore it.
Suggested change
- target: 85%
+ target: 90%📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| target: 85% | |
| target: 90% |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@codecov.yml` at line 9, The patch coverage target value has been reduced from
90% to 85% in the codecov configuration, which weakens quality enforcement on
changed code. Either revert the target back to 90% to maintain the original
quality gate, or if the reduction is intentional, add clear documentation and
rationale in the PR description explaining why the target was lowered and
include a follow-up plan to restore it to 90%.
Summary by CodeRabbit
askCLI command to answer questions using a provided HTTP(S) URL through a configured ask plugin.builtin-ai-askplugin, which uses configured AI provider/model settings to generate answers from fetched page content.ask/builtin-ai-ask, including environment variables and updated default config examples.askplugin and setSIBYL_SHOW_SEARCH_DESCRIPTION=true.builtin-ai-asktests for success and error handling.